package com.vcs.frm.domain;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.NumberFormat;
import org.springframework.format.annotation.NumberFormat.Style;

public class Address {

	
	private Long addressId;
	
	@Min(value = 1, message= "Should be between 1 and 200 characters")
	@Max(value = 150, message= "Should be between 1 and 200 characters")
	@Length(min = 1, max = 200, message = "Should be between 1 to 200 characters")
	@Size(min = 1, max = 150)
	@NotNull
	private String addressLineOne;
	
	@Length(min = 1, max = 200, message = "Should be between 1 to 200 characters")
	@NotNull
	private String addressLineTwo;
	
	@Length(min = 1, max = 200, message = "Should be between 1 to 200 characters")
	@NotNull
	private String addressLineThree;
	
	@Length(min = 1, max = 200, message = "Should be between 1 to 200 characters")
	@NotNull
	private String city;
	
	@Length(min = 1, max = 200, message = "Should be between 1 to 200 characters")
	@NotNull
	private int state;
	
	
	@Length(min = 1, max = 200, message = "Should be between 1 to 200 characters")
	@NotNull
	private String country;
	
	@NumberFormat(style = Style.NUMBER)
	@Length(min = 1, max = 6, message = "Should be between 1 to 6 characters")
	@NotNull
	@Min(value = 6, message = "Pincode should be 6 digit long")
	@Max(value = 6, message = "Pincode should be 6 digit long")
	private String zipCode;

	public Address() {
		// TODO Auto-generated constructor stub
	}

	public Long getAddressId() {
		return addressId;
	}

	public void setAddressId(Long addressId) {
		this.addressId = addressId;
	}

	public String getAddressLineOne() {
		return addressLineOne;
	}

	public void setAddressLineOne(String addressLineOne) {
		this.addressLineOne = addressLineOne;
	}

	public String getAddressLineTwo() {
		return addressLineTwo;
	}

	public void setAddressLineTwo(String addressLineTwo) {
		this.addressLineTwo = addressLineTwo;
	}

	public String getAddressLineThree() {
		return addressLineThree;
	}

	public void setAddressLineThree(String addressLineThree) {
		this.addressLineThree = addressLineThree;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Override
	public String toString() {
		return "Address [addressId=" + addressId + ", addressLineOne="
				+ addressLineOne + ", addressLineTwo=" + addressLineTwo
				+ ", addressLineThree=" + addressLineThree + ", city=" + city
				+ ", state=" + state + ", country=" + country + ", zipCode="
				+ zipCode + "]";
	}

}
